package com.rd.student.jike.class2.lihongming.week724_730.Day728;

import java.io.File;

/**
 * @Auther:Heinrich
 * @Date:2023/7/28-07-28-11:14
 * @Description:c230728
 * @version:1.0
 */
public class Factorial {
    public static void main(String[] args) {
        System.out.println(factorial(5));
        File file = new File("E:\\code\\DataStructures\\zrrd");
        listAll(file);
    }

    public static int factorial(int Num) {
        if (Num == 2) {
            return 2;
        }
        return factorial(Num - 1) * Num;
    }

    public static void listAll(File file) {// 获取当前文件下的所有文件及文件夹
        File[] files = file.listFiles();
        if (files == null || files.length == 0) return;
        for (File tmpFile : files) {
            System.out.println(file.getName()+" : "+tmpFile.getName());
//            if (tmpFile.isFile()) {
//                continue;
//            }
            if (tmpFile.isDirectory()) {
                listAll(tmpFile);
            }
        }
    }
}
